<?php
$pdf = Yii::createComponent('application.extensions.MPDF56.mpdf');
    $val=count($dataProvider);

    $html.=' <link rel="stylesheet" type="text/css" href="'.Yii::app()->request->baseUrl.'/css/pdf.css" />

    <table align="center"><tr>
    <td align="center"><b>Empleados</b></td>
    </tr></table>
    Total Resultados: '.$val.'
        <table class="detail-view2" repeat_header="1" cellpadding="1" cellspacing="1" width="100%" border="0">
            <tr class="principal">
                <td class="principal" width="7%">&nbsp;N° Empleado</td>
                <td class="principal" width="7%">&nbsp;Cedula</td>
                <td class="principal" width="14%">&nbsp;Nombre</td>
                <td class="principal" width="14%">&nbsp;Apellido</td>
                <td class="principal" width="14%">&nbsp;Teléfono</td>
                <td class="principal" width="14%">&nbsp;Dirección</td>
                <td class="principal" width="14%">&nbsp;Email</td>
                <td class="principal" width="14%">&nbsp;Estado</td>

            </tr>';
         $i=0;
         
         while($i<$val){
            if ($dataProvider[$i]["Estado"]==1):
                    $a="Activo(a)";
            else:
                    $a="Inactivo(a)";
                endif;
$html.='
            <tr class="odd">
                <td class="odd" width="7%">&nbsp;'.$dataProvider[$i]["ID"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["IDEmpleado"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["NOMBRE"].'</td>    
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["APELLIDO"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["TELEFONO"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["DIRECCION"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["EMAIL"].'</td>
                <td class="odd" width="19%">&nbsp;'.$a.'</td>
    ';
    $html.='</tr>'; $i++;
                        }
    $html.='</table>';


$header='<img src="'.'images/logo.png"/>';

$mpdf=new mPDF('win-1252','LETTER','','',10,10,25,12,5,7);
$mpdf->SetHTMLHeader($header);
$mpdf->SetFooter(' {DATE j/m/Y}|Página {PAGENO}|');
$mpdf->WriteHTML($html);
$mpdf->Output('');
exit;
?>